
/*
*   Date:2022.03.03
*   Author:donghui
*   Description:public private protected
*/

class Counter {
    private var privateValue = 0
    def value = privateValue
    def value_= (newValue: Int): Unit = {
        if (newValue > 0)
            privateValue = newValue
        }
    
    def increment(step: Int): Unit = {
        value += step
        }
    def current(): Int = { value }
    
    def demo() : Unit = {  }
    
}
